/** 
Copyright (c) 2010, Sheikh Abdul Wahid Ahmed
Details @ http://extremecodeworld.codeplex.com/license
**/

using System;
using System.Data;
using System.Xml;
using System.IO;
using Config=System.Configuration; 

namespace EXtremecode.PresentationLayer
{
	/// <summary>
	/// Summary description for Provider.
	/// </summary>
	public class Provider
	{

        public static string ExportTemplateFilePath
		{
			get
			{
				string str=Config.ConfigurationManager.AppSettings[Keys.EXPORT_TEMPLATE_FILE_PATH];
				if(str == null || str==string.Empty)
				{
					//default
                    str = "ExportTemplate.htm";
				}

                return System.AppDomain.CurrentDomain.BaseDirectory + str;

			}
		}

        public static string ExportStyleSheetPath
        {
            get
            {
                string str = Config.ConfigurationManager.AppSettings[Keys.EXPORT_STYLE_SHEET_PATH];
                if (str == null || str == string.Empty)
                {
                    //no default value
                    return null;
                }
                return System.AppDomain.CurrentDomain.BaseDirectory + str;

            }
        }

        public static int NumberOfDisplayPages
        {
            get
            {
                string str = Config.ConfigurationManager.AppSettings[Keys.NUMBER_OF_DISPLAY_PAGES];
                int numberOfDisplayPages = 0;
                if (str == null || str == string.Empty || !int.TryParse(str,out numberOfDisplayPages) )
                {
                    //no default value
                    numberOfDisplayPages = 15;
                }
                return numberOfDisplayPages;

            }
        }

        public static string PageSizesList
        {
            get
            {
                string str = Config.ConfigurationManager.AppSettings[Keys.PAGE_SIZES_LIST];
                if (str == null || str == string.Empty)
                {
                    //no default value
                    str = "10,20,30";
                }
                return str;

            }
        }




	}
}
